import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HrRecruitmentApplyVO, HrRecruitmentApplyForm, HrRecruitmentApplyQuery } from '@/api/general/humanresources/onboard/recruitment/types';

/**
 * 查询招聘需求审批列表
 * @param query
 * @returns {*}
 */

export const listHrRecruitmentApply = (query?: HrRecruitmentApplyQuery): AxiosPromise<HrRecruitmentApplyVO[]> => {
  return request({
    url: '/humanresource/hrRecruitmentApply/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询招聘需求审批详细
 * @param id
 */
export const getHrRecruitmentApply = (id: string | number): AxiosPromise<HrRecruitmentApplyVO> => {
  return request({
    url: '/humanresource/hrRecruitmentApply/' + id,
    method: 'get'
  });
};

/**
 * 新增招聘需求审批
 * @param data
 */
export const addHrRecruitmentApply = (data: HrRecruitmentApplyForm) => {
  return request({
    url: '/humanresource/hrRecruitmentApply',
    method: 'post',
    data: data
  });
};

/**
 * 修改招聘需求审批
 * @param data
 */
export const updateHrRecruitmentApply = (data: HrRecruitmentApplyForm) => {
  return request({
    url: '/humanresource/hrRecruitmentApply',
    method: 'put',
    data: data
  });
};

/**
 * 删除招聘需求审批
 * @param id
 */
export const delHrRecruitmentApply = (id: string | number | Array<string | number>) => {
  return request({
    url: '/humanresource/hrRecruitmentApply/' + id,
    method: 'delete'
  });
};
